package com.keradi.onlab;

import java.util.ArrayList;

public class EndPoint {
	
	public static final int START = 0;
	public static final int FINISH = 1;
	

	private int mEndPointID;
	private int mType;
	private String mRealTime;
	private String mEstimatedTime;
	private ArrayList<EndPoint> mPreviouses;
	private ArrayList<EndPoint> mNexts;
	private Task mTask;
	
	
	public EndPoint(int endPointID, int type, String realTime, String estimatedTime)
	{
				
		mEndPointID = endPointID;
		mType = type;
		mRealTime = realTime;
		mEstimatedTime = estimatedTime;
		mPreviouses = null;
		mNexts = null;
		
		
		
	}
	
	
	public int getEndPointID()
	{
		return mEndPointID;
	}
	
	public int getType()
	{
		return mType;
	}
	
	public void setTask(Task task)
	{
		mTask = task;
	}
	
	public Task getTask(Modell modell)
	{
		if (mTask == null) {
			mTask = modell.getTask(this);
		}
		return mTask;
	}
	
	public String getRealTime()
	{
		return mRealTime;
	}
	
	public String getEstimatedTime()
	{
		return mEstimatedTime;
	}
	
	public ArrayList<EndPoint> getPreviousEndPoints(Modell modell) {
		if (mPreviouses == null) {
			mPreviouses = modell.getPreviousEndPoints(this);
		}
		return mPreviouses;
	}
	
	public ArrayList<EndPoint> getNextEndPoints(Modell modell) {
		if (mNexts == null) {
			
			mNexts = modell.getNextEndPoints(this);
			
		}
		return mNexts;
	}
	
}
